# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>

pkgname=python-openstacksdk
pkgver=1.0.1
_commit=3876f3f6d9d45f22de7429e14744e66439d90fdf
pkgrel=2
pkgdesc="An SDK for building applications to work with OpenStack"
arch=('any')
url="https://developer.openstack.org/sdks/python/openstacksdk"
license=('Apache')
depends=('python-six' 'python-pbr' 'python-yaml' 'python-jsonpatch' 'python-appdirs'
         'python-keystoneauth1' 'python-os-service-types' 'python-deprecation'
         'python-requestsexceptions' 'python-decorator' 'python-jmespath' 'python-iso8601'
         'python-netifaces' 'python-dogpile.cache' 'python-cryptography')
makedepends=('git' 'python-setuptools')
checkdepends=('python-stestr' 'python-ddt' 'python-requests-mock' 'python-oslotest'
              'python-jsonschema' 'python-oslo-config' 'python-prometheus_client' 'python-hacking')
source=("git+https://github.com/openstack/openstacksdk.git#commit=$_commit")
sha512sums=('SKIP')

build() {
  cd openstacksdk
  python setup.py build
}

check() {
  # From https://github.com/openstack/openstacksdk/blob/master/tox.ini
  export OS_LOG_CAPTURE=true OS_STDOUT_CAPTURE=true OS_STDERR_CAPTURE=true

  cd openstacksdk
  # TODO
  stestr run || echo "Tests failed"
}

package() {
  cd openstacksdk
  python setup.py install --root="$pkgdir" --optimize=1
}

# vim:set ts=2 sw=2 et:
